export default () => {
  const hd = () => {
    // app
    const appEl = document.querySelector('#app') as HTMLDivElement
    // mouseenter没有鼠标穿透效果
    appEl.addEventListener('mouseenter', () => {
      console.log('禁止穿透')
      window.api.setIgnoreMouseEvents(false)
    })

    // body
    // mouseover有穿透效果
    document.body.addEventListener('mouseover',(event:MouseEvent) => {
      if(event.target === document.body) {
        console.log('开启穿透');
        window.api.setIgnoreMouseEvents(true,{ forward: true })
      }
    })
  }

  return { hd }
}
